package FlyGame;

import org.junit.Test;

import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

public class OverFrame extends JFrame {
    OverPanel overPanel;

    public OverFrame() throws HeadlessException {

        this.setTitle("Fly-Bird 小游戏");
        this.setBounds(270,200,230,320);
        this.setResizable(false);
        this.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
        overPanel = new OverPanel();
        overPanel.reGame.addActionListener(new MyActionListener());
        this.add(overPanel);

    }

    @Override
    public void setVisible(boolean b) {
        super.setVisible(b);
    }

    class MyActionListener implements ActionListener {

        @Override
        public void actionPerformed(ActionEvent e) {
            dispose();
        }
    }
}
